#pragma once
#include <glm/glm.hpp>

class Camera {
public:
    void setTarget(const glm::vec3& t) { target=t; }
    void setDistance(float d) { distance=d; }
    void addDistance(float v) { distance+=v; if(distance<2.0f) distance=2.0f; }
    void addYaw(float v) { yaw+=v; }
    void addPitch(float v) { pitch+=v; if(pitch>1.5f)pitch=1.5f; if(pitch<-1.5f)pitch=-1.5f; }
    glm::mat4 view() const;
    glm::mat4 proj(float aspect) const;
    glm::vec3 position() const;
    const glm::vec3& targetRef() const { return target; }
private:
    glm::vec3 target{0,0,0};
    float distance=8.0f;
    float yaw=0.8f;
    float pitch=0.6f;
};